1. Field of the Invention
The present invention relates to a data storage control method and system, and more particularly to a method and a system which controls writing of image data to a storage medium. The present invention also relates to a data storage system with the above control function.
2. Description of the Related Art
Technology for compressing and coding moving image data and storing it on various types of storage media is evolving. One of typical technology is MPEG. Today, many manufacturers are developing multimedia units and trying to market MPEG-conforming products.
FIG. 1 shows an outline configuration of an MPEG-conforming image recording system with a CCD camera 2. This image recording system has a compression module 4, a variable length coding module 6, and an image recording control system 8. The compression module 4 performs Discrete Cosine Transformation (hereafter called DCT) on video input data and then quantizes the transformed data. The compression module 4 also compresses data through motion compensation. The variable length coding module 6 uses a probability method to code in the variable length mode the data that has been quantized (hereafter called quantized data) so that the amount of coded data is minimized. The image recording control system 8 has an external medium read/write controller (hereafter called an R/W controller) 10 which controls reading coded of data from and writing of coded data to, an external recording medium 12.
In this configuration, video signals generated by the CCD camera 2 are sent to the compression module 4. The compression module 4 disassembles the video signals into discrete space frequency components, one macro block at a time, each macro block being composed of a plurality of picture elements (pixels) of a picture; the module then quantizes the signals into a specified number of levels. The variable length coding module 6 codes the quantized data and generates MPEG coded data streams. An external R/W controller writes the streams on an external recording medium 12.
When image data is coded into variable length data by the above image recording system, how much image data is recorded in terms of time depends on the type of image data to be recorded (this length of time is referred to as a recording time). The amount of coded data depends on the type of data. Therefore, the recording medium sometimes becomes full before all the image data is recorded, in which case image recording is ended prematurely. This means that, if an image recording system user does not know a recording time, he or she has sometimes image recording interrupted and therefore cannot record all desired image data successfully.
No efficient method has been developed for predicting how long a user may continue recording on a current medium. Even if the user can predict the remaining recording time of the current medium, the actual recording time depends on some other factors such as the type of image data which will be recorded. Even when the predicted remaining recording time is shorter than the actual recording time, it is desirable that recording be continued without interruption.
Another solution is to extend a recording time by controlling the amount of code. A disadvantage to this solution is that a less amount of code degrades the quality of decoded image data.
The above problem is not limited to image data recording. The problem also applies when other types of data, such as voice data, are recorded on an external storage medium.
The present invention seeks to solve the problems associated with a prior art described above. It is an object of the present invention to provide a data storage control method and system that prevent a situation in which recording is interrupted because an external medium becomes full before all intended data is recorded. It is another object of the present invention to provide a data storage system with the function described above.
(1) A data storage control method according to the present invention is a method for controlling storage of data on a removable external recording medium which can be installed on a storage system, comprising the steps of stopping storing data on the external recording medium when judgment is made not to store data on the external recording medium and, at the same time, storing data, which follows data stored on the external recording medium, in an internal storage means.
Preferably, data to be processed by this method is image data, voice data, and so forth. As will be described later, the method according to the present invention is applicable to the recording of still image data and moving image data. An external recording medium, a unit separate from an image recording system, may be exchanged as necessary. This external recording medium may be an IC card, floppy disk, CD-ROM, or magnetic tape, or the like. The external recording medium is an electrically-, magnetically-, or optically-accessible medium. So is the internal storage mean; a semiconductor memory is used as necessary.
For example, judgment xe2x80x9cnot to store data on the external recording mediumxe2x80x9d may be made when the amount of data on the external recording medium has reached a predetermined amount. The predetermined amount should preferably be set to the size of the data storage area on the external recording medium or to a value close to it.
When judgment is made in this configuration that no more data should be stored on the external recording medium, data which follows data stored on the external recording medium is held in the internal storage means to allow all desired data to be recorded without interruption.
While data is being stored on the external recording medium in the system according to the present invention (that is, during usual recording time), one of the following two types of processing may be performed on the internal storage means. During usual recording time, (A) data is not stored in the internal storage means, and (B) data is stored and updated in the internal storage means.
A method according to the present invention in which (A) described above is performed is a method for controlling storage of data which comprises steps of comparing an amount of free space on the external recording medium with an amount of data to be stored next; storing data on the external recording medium if the amount of free space is larger than the amount of data; and storing data in the internal storage means if the amount of free space is insufficient. After the data destination is changed, data is stored in the internal storage means. In this case, the time when xe2x80x9cthe free space is insufficientxe2x80x9d corresponds to the time when xe2x80x9cjudgment is made that no more data should be stored on the external recording medium which is separate from the systemxe2x80x9d described above.
For example, the amount of image data coded into variable length data is variable. Therefore, in the above configuration, the comparison between amount of data to be stored next with the amount of free space depends on the amount of data.
A method according to the present invention in which (B) described above is performed is a method for controlling storage of data, wherein data in the internal storage means is updated by sequentially-entered data and wherein, when the amount of data stored on the external recording medium has reached a predetermined amount, data which follows data stored on the external recording medium is held in the internal storage means.
The time xe2x80x9cwhen the amount of data stored on the external recording medium has reached a predetermined amountxe2x80x9d corresponds to the time when xe2x80x9cjudgment is made that no more data should be stored on the external recording mediumxe2x80x9d described above. In this case, the xe2x80x9cpredetermined amountxe2x80x9d may be the maximum size of the space available for storing desired data or an amount smaller than but close to the maximum. As described above, a module for comparing the amount of free space with the amount of data to be stored next may be added to this configuration. The xe2x80x9cpredetermined amountxe2x80x9d described above may vary according to the data to be stored.
In this aspect, (a) data may be stored on the external recording medium and in the internal storage means concurrently, and data stored in the internal storage means may be updated during usual recording time. (b) Data may be sent to the internal storage means first, and then data may be sent from the internal storage means to the external recording medium. (c) Conversely, data may be sent to the external recording medium first, and then data may be sent from the external recording medium to the internal storage means.
Preferably, when a first external recording medium is changed to a second external recording medium, data stored in the internal storage means is stored on the second external recording medium.
(2) Another aspect of the present invention is a method for controlling storage of data on a removable external recording medium which can be installed on a storage system wherein, when the external recording medium is removed, data which follows data stored on the external recording medium is held in an internal storage means and, preferably, wherein, when a second external recording medium is installed, data which is held in the internal storage means and which is entered after a first external recording medium is removed is stored in the second external recording medium.
This configuration is preferable for a case in which the external recording medium is removed before judgment is made not to store data on it, for example, when it becomes 50% full. In such a case, this configuration allows the user to continue recording while exchanging the external recording medium. Simply installing a new external recording medium moves data from the internal storage means to the installed external medium, thereby allowing data to be recorded seamlessly across medium exchange.
A method used in this configuration may be a method wherein data in the internal storage means is updated by sequentially-entered data and wherein, when the amount of data stored on the external recording medium has reached a predetermined amount, data which follows data stored on the external recording medium is held in the internal storage means.
(3) A data storage control system according to the present invention comprises an external storage controller which stores data on a removable external recording medium which can be installed on a storage system; an internal storage controller which stores data in internal storage means on an auxiliary basis; and a main controller which controls the external storage controller and the internal storage controller, the main controller stopping writing data on the external recording medium and holding data, which follows data stored on the external recording medium, in the internal storage means when judgment is made not to store data on the external recording medium. In this configuration, the image recording control method described above is implemented as a system.
(4) A data storage system according to the present invention comprises an encoder for coding entered data into variable length data; an external storage controller which stores data on a removable external recording medium which can be installed on said storage system; an internal storage controller which stores data in internal storage means on an auxiliary basis; and a main controller which controls the external storage controller and the internal storage controller, the main controller stopping writing data on the external recording medium and holding data, which follows data stored on the external recording medium, in the internal storage means when judgment is made not to store data on the external recording medium.
Preferably, the main controller has a comparator which compares an amount of free space on the external recording medium with an amount of data to be stored next; wherein the main controller stores data on the external recording medium if the amount of free space is larger than the amount of data; and wherein the main controller stores data in the internal storage means if the mount of free space is insufficient.
For example, when image data is coded into variable length data, the amount of code generated in a short period of time is variable. This means that the amount of image data (for example, the number of pictures of image data or the recording time of moving image data) is variable. In such a case, the system according to the present invention prevents a situation in which a desired image data is not recorded just because the amount of data cannot be predicted precisely in advance. Therefore, the present invention is applicable to a data storage system which contains a variable amount of data, for example, an image recording system which codes data into variable length data.
In most cases, a configuration such as the one used by the present invention does not have a large-capacity internal storage means. With this in mind, the system may be configured so that data is written into the internal storage means at a fixed, low rate to allow more data to be stored there. To do so, there are two sample configurations. (a) In one sample configuration, when judgment is made not to store data on the external recording medium, the data coder generates a smaller amount of coded data for transmission to the internal storage means. (b) In another sample configuration, there is provided a data generating means which always generate a small amount of data and this data is used to update data in the internal storage means. When judgment is made not to store data on the external storage medium, data which follows data stored on the external recording medium is held in the internal storage means.